Skip to content

fix: replace HashMap with ConcurrentHashMap to fix ConcurrentModificationException - #9

Merged
arnaud-thorel-of merged 1 commit into
mainfrom
fix/concurrent-modification-validator-map
Mar 25, 2026
Merged

fix: replace HashMap with ConcurrentHashMap to fix ConcurrentModificationException#9
arnaud-thorel-of merged 1 commit into
mainfrom
fix/concurrent-modification-validator-map

Conversation

@arnaud-thorel-of

Copy link
Copy Markdown
Contributor

Summary

  • FilterFieldValidatorService.VALIDATOR_MAP était un HashMap statique accédé par plusieurs threads via computeIfAbsent
  • HashMap n'est pas thread-safe : en contexte concurrent, computeIfAbsent peut lever une ConcurrentModificationException
  • Remplacement par ConcurrentHashMap dont computeIfAbsent est atomique

Root cause

java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent
at FilterFieldValidatorService.getValidator(FilterFieldValidatorService.java:68)

Test plan

  • Vérifier que les tests unitaires existants passent
  • Tester en charge avec plusieurs appels search() simultanés

@arnaud-thorel-of
arnaud-thorel-of merged commit 100f518 into main Mar 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant